<?php
namespace Home\Controller;
use Think\Controller;

class ShareController extends Controller {
    public function index(){
      $nonceStr = createNonceStr();
      $jsapi_ticket = getJsApiTicket();
      $timestamp = time();
      $url = "http://".$_SERVER['SERVER_NAME'].__SELF__;
      $string1 = "jsapi_ticket=".$jsapi_ticket."&noncestr=".$nonceStr."&timestamp=".$timestamp."&url=".$url;
      echo $string1;
      $signature=sha1($string1);
         $data = array(
           'appid'=>APPID,
           'timestamp'=>$timestamp,
           'nonceStr'=>$nonceStr,
           'jsapi_ticket'=>$jsapi_ticket,
           'signature'=>$signature,
           'url'=> $url,
          );
       
        $this->assign($data);
        $this->display();
    }
    
     
}